'use strict';

const Controller = require('egg').Controller;

class ProductController extends Controller {
// 首页菜单
  async list() {
    const { ctx } = this;
    const list = await ctx.service.product.list();
    ctx.body = {
      code: 1,
      data: list,
    };
  }
  // 分类
  async classfy() {
    const { ctx } = this;
    const classfyData = await ctx.service.product.classfyData();
    ctx.body = {
      code: 1,
      data: classfyData,
    };
  }
}

module.exports = ProductController;
